package com.hqyj.ctxp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hqyj.ctxp.mapper.ImageMapper;
import com.hqyj.ctxp.pojo.Image;
import com.hqyj.ctxp.service.ImageService;
import com.hqyj.ctxp.utils.ResultInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ImageServiceImpl extends ServiceImpl<ImageMapper, Image> implements ImageService {

    @Autowired
    private ImageMapper imageMapper;

    // 查询所有图片
    @Override
    public ResultInfo selectImageAll() {
        List<Image> images = imageMapper.selectList(new QueryWrapper<Image>());
        if (images != null) {
            return new ResultInfo(200, "select success", images);
        }
        return new ResultInfo(500, "fail success", null);
    }

}
